/***************************************************************************************************
** WHAT: 	Replication file for the paper
			"Institutional mistrust and child vaccination coverage in Africa",
			by Nik Stoop, Kalle Hirvonen and Jean-François Maystadt.
			Published in BMJ:Global Health
			Open access through http://dx.doi.org/10.1136/bmjgh-2020-004595
				
			Below you find the code to reproduce the Tables and Figures,
			
** WHEN: 	April '21

** WHO:	 	Nik Stoop, nik.stoop@uantwerp.be
***************************************************************************************************/


* NOTE: First run the do-file that compiles the analytical database (compileDB_trust vaccines_BMJ.do)


clear all
global data "ADD LOCATION OF DATABASES HERE"
set more off
set scheme s1mono
set matsize 5000	
	
	
***********************************************************	
*** MANUSCRIPT: Tables & Figures in order of appearance ***
***********************************************************

	
	*** Table 1: Summary statistics on child vaccination status and mistrust in public institutions
		use "$data/DHS_AB_BMJ.dta",clear
		xtset idregion
		xtsum y1_none y1_full
		xtsum notrust_president notrust_parliament notrust_electoral notrust_courts notrust_locgov znotrust_index
	
	
	*** Figure 1: Child vaccination status and degree of institutional mistrust, by sub-national region
		* The maps were created with QGIS
		use "$data/maps_BMJ.dta",clear
		pwcorr znotrust_index y1_full,sig
		pwcorr znotrust_index y1_none,sig

	
	*** Table 2: Regression results for the association between institutional mistrust and child vaccination status
		use "$data/DHS_AB_BMJ.dta",clear
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c, cluster(idregion)
		}	
		
		esttab using "$data/Table_2.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(5)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	

		
	***	Figure 2: Regression results for the association between institutional mistrust and vaccine type
		use "$data/DHS_AB_BMJ.dta",clear
		local y1 "bcg polio1 polio2 polio3 measles dpt1 dpt2 dpt3"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		
		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		mat `y'=r(table)
		gen b`y'=`y'[1,1]
		gen low`y'=`y'[5,1]
		gen high`y'=`y'[6,1]
		gen N`y'=e(N)
		}	
		
		esttab using "$data/Fig_2.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(2)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
		
		keep bbcg lowbcg highbcg Nbcg bpolio1 lowpolio1 highpolio1 Npolio1 bpolio2 lowpolio2 highpolio2 Npolio2 bpolio3 lowpolio3 highpolio3 Npolio3 bmeasles lowmeasles highmeasles Nmeasles bdpt1 lowdpt1 highdpt1 Ndpt1 bdpt2 lowdpt2 highdpt2 Ndpt2 bdpt3 lowdpt3 highdpt3 Ndpt3
		keep if _n==1
		rename *bcg *1
		rename *polio1 *2
		rename *polio2 *3
		rename *polio3 *4
		rename *measles *5
		rename *dpt1 *6
		rename *dpt2 *7
		rename *dpt3 *8
		gen x=1
		reshape long b low high N, i(x) j(n)
		drop x
		
		tostring N, replace
		replace N=	"166,277"	if N==	"166277"
		replace N=	"166,288"	if N==	"166288"
		replace N=	"166,348"	if N==	"166348"
		replace N=	"166,520"	if N==	"166520"
		replace N=	"166,670"	if N==	"166670"
		replace N=	"166,911"	if N==	"166911"
		replace N=	"166,953"	if N==	"166953"

		label var N "N"
		
		label define n ///
		1	"bcg" ///
		2	"polio1" ///
		3	"polio2" ///
		4	"polio3" ///
		5	"measles" ///
		6	"dpt1" ///
		7	"dpt2" ///
		8	"dpt3" ///
		, replace
		label values n n 
		label var n "Outcome"
	 
		admetan b low high, nowt nooverall  label(namevar=n, yearvar=N) forestplot(xlabel(0.8(0.1)1.2) xmtick(0.8(0.05)1.2, gmin gmax) null(1) xtitle("Odds ratio for a one-standard deviation increase in institutional mistrust",   margin(medium) size(medium))  boxopt( mcolor(none))   pointopt(mcolor(navy) msymbol(circle) msize(small)) ciopt(lcolor(navy) lwidth(large)) scheme(s1color) aspect(0.7)  graphregion(margin(tiny)) plotregion(margin(tiny) lpattern(blank)) plotregion(margin(tiny))) effect("Odds ratio")  
		
		
	***	Table 3: Regression results for the association between different dimensions of institutional mistrust and child vaccination status
		use "$data/DHS_AB_BMJ.dta",clear
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' notrust_president 	i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' notrust_parliament i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' notrust_electoral 	i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' notrust_courts 	i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' notrust_locgov 	i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		}	
		
		esttab using "$data/Table_3.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(5)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(notrust*)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
		
		
		
*********************************************************		
*** APPENDIX: Tables & Figures in order of appearance ***
*********************************************************		
	
	*** Table A.1 Child vaccination status in the DHS surveys included in the sample
		use "$data/DHS_AB_BMJ.dta",clear	
		table country_year, c(freq)		
		table country_year [iw=wgt], c(mean y1_none mean y1_full)
		
		
	*** Table A.2 Mistrust in public institutions
		use "$data/DHS_AB_BMJ.dta",clear	
		sum notrust_president notrust_parliament notrust_electoral notrust_courts notrust_locgov
		
	
	*** Table A.3 Correlation matrix of insitutional mistrust variables
		use "$data/DHS_AB_BMJ.dta",clear	
		pwcorr notrust_president notrust_parliament notrust_electoral notrust_courts notrust_locgov,sig

	
	*** Table A.4 Principal Components
		use "$data/DHS_AB_BMJ.dta",clear	
		egen region_AByear=group(idregion round)
		bysort region_AByear:gen region_AByearx=_n		
		pca notrust_president notrust_parliament notrust_electoral notrust_courts notrust_locgov if region_AByearx==1 
	
	
	*** Table A.5 Correlations between the mistrust index and its five dimensions
		use "$data/DHS_AB_BMJ.dta",clear	
		pwcorr notrust_index notrust_president notrust_parliament notrust_electoral notrust_courts notrust_locgov,sig
	
	
	*** Table A.6 Summary statistics for the index of mistrust in public institutions
		use "$data/DHS_AB_BMJ.dta",clear	
		sum notrust_index znotrust_index
	
	
	*** Table A.7 Mistrust in public institutions in the Afrobarometer surveys included in the sample
		use "$data/DHS_AB_BMJ.dta",clear	
		egen country_round=group(country round),label		
		table country_round, c(freq)
		table country_round, c(mean notrust_president mean notrust_parliament mean notrust_electoral)
		table country_round, c(mean notrust_courts mean notrust_locgov mean znotrust_index)

	
	*** Table A.8 Summary statistics at the level of the child, parents and household
		use "$data/DHS_AB_BMJ.dta",clear	
		sum y1_none y1_full bcg polio1 polio2 polio3 measles dpt1 dpt2 dpt3 
		sum sex age_mother age_mother_1stbirth literate school_mother school_father sex_head wealth nr_under5_w nr_hh_w urban
		sum visit_12m problem_permission problem_money problem_distance problem_alone
		
	
	*** Table A.9 Child birth-order and -interval categories
		use "$data/DHS_AB_BMJ.dta",clear	
		tab birthcat 
	
	
	*** Table A.10 Child age cohorts
		use "$data/DHS_AB_BMJ.dta",clear	
		tab age_c
	
	
	*** Figure A.1 Correlation between regional institutional mistrust and child vaccination coverage	
		use "$data/maps_BMJ.dta",clear
		
		egen country_id=group(country),label
		
		* Panel A
		twoway ///
		(scatter y1_none znotrust_index if country_id==1 , sort mcolor(green) 	msymbol(circle)	 yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle) yaxis(1)) /// 
		(scatter y1_none znotrust_index if country_id==3 , sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==4 , sort mcolor(blue) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==5,  sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==6,  sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==7,  sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==8,  sort mcolor(yellow)  msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==9,  sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==10, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==11, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==12, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==13, sort mcolor(yellow)  msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==14, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==15, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==16, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==17, sort mcolor(yellow)  msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==18, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==19, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==21, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(lfit y1_none znotrust_index) ///
		, ytitle(% none of the basic vaccinations) xtitle(Standardized institutional mistrust index) title("`y'") legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa"))
				
		* Panel B
		twoway ///
		(scatter y1_full znotrust_index if country_id==1 , sort mcolor(green) 	msymbol(circle)	 yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle) yaxis(1)) /// 
		(scatter y1_full znotrust_index if country_id==3 , sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==4 , sort mcolor(blue) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==5,  sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==6,  sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==7,  sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==8,  sort mcolor(yellow)  msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==9,  sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==10, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==11, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==12, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==13, sort mcolor(yellow)  msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==14, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==15, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==16, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==17, sort mcolor(yellow)  msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==18, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==19, sort mcolor(green)  	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==21, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(lfit y1_full znotrust_index) ///
		, ytitle(% all basic vaccinations) xtitle(Standardized institutional mistrust index) title("`y'") legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa"))
		
		
		
	*** Figure A.2 Correlation between country-survey institutional mistrust and child vaccination coverage
		use "$data/DHS_AB_BMJ.dta",clear	

		collapse znotrust_index notrust_president notrust_parliament notrust_electoral notrust_locgov notrust_courts y1_none y1_full (first)country countrycode, by(country_id start_year)	
		sort country_id start_year
		
		*** Panel A
		twoway ///
		(scatter y1_none znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==3 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) /// 
		(scatter y1_none znotrust_index if country_id==4 , sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==5 , sort mcolor(blue) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==14, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==15, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==16, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==17, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==18, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==21, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==23, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==24, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==29, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==30, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==31, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==34, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==35, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==36, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==37, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==38, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(lfit y1_none znotrust_index) ///
		,ytitle(% none of the basic vaccinations) xtitle(Standardized institutional mistrust index) legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa")) title("Panel A", size(medium))			
		
			
		*** Panel B
		twoway ///
		(scatter y1_full znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==3 , sort mcolor(green) 	msymbol(circle) yaxis(1)) /// 
		(scatter y1_full znotrust_index if country_id==4 , sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==5 , sort mcolor(blue) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==14, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==15, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==16, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==17, sort mcolor(yellow)	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==18, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==21, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==23, sort mcolor(yellow)	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==24, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==29, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==30, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==31, sort mcolor(yellow)	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==34, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==35, sort mcolor(green) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==36, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==37, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==38, sort mcolor(red) 	msymbol(circle) yaxis(1)) ///
		(lfit y1_full znotrust_index) ///
		,ytitle(% all basic vaccinations) xtitle(Standardized institutional mistrust index) legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa")) title("Panel B", size(medium))
		

		*** Panel C
		twoway ///
		(scatter y1_none znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==3 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) /// 
		(scatter y1_none znotrust_index if country_id==4 , sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==5 , sort mcolor(blue) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==14, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==15, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==16, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==17, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==18, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==21, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==23, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==24, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==29, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==30, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==31, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==34, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==35, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==36, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==37, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==38, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(lfit y1_none znotrust_index) if start_year<2012 ///
		,ytitle(% none of the basic vaccinations) xtitle(Standardized institutional mistrust index) legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa"))	title(Panel C: 2004-2011, size(medium))	
		
		
		*** Panel D
		twoway ///
		(scatter y1_none znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==3 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) /// 
		(scatter y1_none znotrust_index if country_id==4 , sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==5 , sort mcolor(blue) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==14, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==15, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==16, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==17, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==18, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==21, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==23, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==24, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==29, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==30, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==31, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==34, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==35, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==36, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==37, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_none znotrust_index if country_id==38, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(lfit y1_none znotrust_index) if start_year>2011 ///
		,ytitle(% none of the basic vaccinations) xtitle(Standardized institutional mistrust index) legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa"))	title(Panel D: 2012-2018, size(medium))	
			
			
		*** Panel E	
		twoway ///
		(scatter y1_full znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==3 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) /// 
		(scatter y1_full znotrust_index if country_id==4 , sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==5 , sort mcolor(blue) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==14, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==15, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==16, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==17, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==18, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==20, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==21, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==22, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==23, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==24, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==29, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==30, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==31, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==34, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==35, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==36, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==37, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==38, sort mcolor(red) 	msymbol(circle)  yaxis(1)) ///
		(lfit y1_full znotrust_index) if start_year<2012 ///
		,ytitle(% all basic vaccinations) xtitle(Standardized institutional mistrust index) legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa")) title(Panel E: 2004-2011, size(medium))	
		
		
		*** Panel F
		twoway ///
		(scatter y1_full znotrust_index if country_id==2 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==3 , sort mcolor(green) 	msymbol(circle)  yaxis(1)) /// 
		(scatter y1_full znotrust_index if country_id==4 , sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==5 , sort mcolor(blue) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==14, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==15, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==16, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==17, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==18, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==20, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==21, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==22, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==23, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==24, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==29, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==30, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==31, sort mcolor(yellow)	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==34, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==35, sort mcolor(green) 	msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==36, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==37, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(scatter y1_full znotrust_index if country_id==38, sort mcolor(red) 		msymbol(circle)  yaxis(1)) ///
		(lfit y1_full znotrust_index) if start_year>2011 ///
		,ytitle(% all basic vaccinations) xtitle(Standardized institutional mistrust index) legend(order(4 "Central Africa" 7 "East Africa" 8 "Southern Africa" 9 "West Africa"))	title(Panel F: 2012-2018, size(medium))	
		
		
	
	*** Table A.11 Robustness to different subsets of control variables
		use "$data/DHS_AB_BMJ.dta",clear
		
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index , cluster(idregion)
		eststo: xi: logistic `y' znotrust_index i.year i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' i.idregion  i.age_c , cluster(idregion)
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `access' `accessm' i.idregion  i.age_c , cluster(idregion)
		}		

		esttab using "$data/Table_A11.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.05 ** 0.01 *** 0.001)  nogaps label drop (_Iyear* _Iidreg* _Iage*)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
			
		
	
	*** Table A.12 Robustness to different levels of fixed effects
		use "$data/DHS_AB_BMJ.dta",clear
		
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index `kid' `parents' `HH' `accessm' `access' , cluster(idregion)
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' , cluster(idregion)
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion , cluster(idregion)
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		}	
		
		esttab using "$data/Table_A12.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.05 ** 0.01 *** 0.001)   nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
	
	
	
	*** Table A.13 Robustness to controlling for maternal religion
		use "$data/DHS_AB_BMJ.dta",clear
		
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"
		
		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index i.religion_mother i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c, cluster(idregion)
		}	
		
		esttab using "$data/Table_A13.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(5)par))  star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index _Irelig*)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" )) 
	
	
	
	*** Table A.14 Information on consent to an Anemia or HIV blood test
		use "$data/DHS_AB_BMJ.dta",clear
		gen info=(refuse_test!=.)
		tab info
	
	
	
	*** Table A.15 Summary statistics on refusal of blood test
		use "$data/DHS_AB_BMJ.dta",clear
		sum refuse_test lm_refuse_test
	
	
	
	*** Figure A.3 Cluster-level refusal of blood test
		use "$data/DHS_AB_BMJ.dta",clear
		hist lm_refuse_test , percent xtitle(Cluster-level refusal of blood test) title(Panel A: full sample)
		hist lm_refuse_test if lm_refuse_test!=0 , percent xtitle(Cluster-level refusal of blood test) title(Panel B: subsample of clusters with refusal of blood test)

			
			
	*** Table A.16 Child vaccination status and non-institutional mistrust indicators
		use "$data/DHS_AB_BMJ.dta",clear

		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' notrust_relatives i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' notrust_general i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		eststo: xi: logistic `y' lm_refuse_test i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		}	
			
		esttab using "$data/Table_A16.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.05 ** 0.01 *** 0.001)  nogaps label keep(*trust* *refuse*)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
	

	
	*** Table A.17 Robustness to controlling for a proxy of mistrust in medicine.
		use "$data/DHS_AB_BMJ.dta",clear
	
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index lm_refuse_test i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		}	
		
		esttab using "$data/Table_A17.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.05 ** 0.01 *** 0.001)  nogaps label keep(*trust* *refuse*)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
	
	
	
	
	*** Table A.18 Robustness to excluding potential migrants
		use "$data/DHS_AB_BMJ.dta",clear
		
		tab nomigrant 
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c if nomigrant==1 , cluster(idregion)
		}	
				
		esttab using "$data/Table_A18.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
	
	
	
		
	*** Figure A.4 Robustness to dropping each country's observations one at a time
		use "$data/DHS_AB_BMJ.dta",clear

		*** Panel A
			levelsof country, local(countries) 
			local kid "sex i.birthcat"
			local parents "age_mother age_mother_1stbirth literate school_mother school_father"
			local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
			local access "visit_12m problem_permission problem_money problem_distance problem_alone"
			local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

			eststo clear
			foreach y of local countries {	
			eststo: xi: logistic y1_none znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c if country!="`y'", cluster(idregion)
			}	
							
			coefplot ///
			est1 , bylabel(Benin) ||  /// 
			est2 , bylabel(Burkina Faso) ||  /// 
			est3 , bylabel(Burundi) ||  /// 
			est4 , bylabel(Cameroon) ||  /// 
			est5 , bylabel(Ghana) ||  /// 
			est6 , bylabel(Guinea) ||  /// 
			est7 , bylabel(Kenya) ||  /// 
			est8 , bylabel(Lesotho) ||  /// 
			est9 , bylabel(Liberia) ||  /// 
			est10 , bylabel(Malawi) ||  /// 
			est11 , bylabel(Mali) ||  /// 
			est12 , bylabel(Mozambique) ||  /// 
			est13 , bylabel(Namibia) ||  /// 
			est14 , bylabel(Niger) ||  /// 
			est15 , bylabel(Senegal) ||  /// 
			est16 , bylabel(Sierra Leone) ||  /// 
			est17 , bylabel(South Africa) ||  /// 
			est18 , bylabel(Tanzania) ||  /// 
			est19 , bylabel(Togo) ||  /// 
			est20 , bylabel(Uganda) ||  /// 
			est21 , bylabel(Zambia) ||  /// 
			est22 , bylabel(Zimbabwe) ||  /// 
			, keep(znotrust_index) eform bycoefs xline (1) xlabel(1, add format(%9.2f) labsize(vsmall)) title("None of the basic vaccinations", size(medium)) levels(95) ///
			headings(1="{bf: }") mlabel format(%9.3f) mlabposition(2) mlabgap(*1) mlabsize(vsmall) msize(vsmall) m(d) ylabel(,labsize(small))
		
		
		*** Panel B
			levelsof country, local(countries) 
			local kid "sex i.birthcat"
			local parents "age_mother age_mother_1stbirth literate school_mother school_father"
			local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
			local access "visit_12m problem_permission problem_money problem_distance problem_alone"
			local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

			eststo clear
			foreach y of local countries {	
			eststo: xi: logistic y1_full znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c if country!="`y'", cluster(idregion)
			}	
			
			coefplot ///
			est1 , bylabel(Benin) ||  /// 
			est2 , bylabel(Burkina Faso) ||  /// 
			est3 , bylabel(Burundi) ||  /// 
			est4 , bylabel(Cameroon) ||  /// 
			est5 , bylabel(Ghana) ||  /// 
			est6 , bylabel(Guinea) ||  /// 
			est7 , bylabel(Kenya) ||  /// 
			est8 , bylabel(Lesotho) ||  /// 
			est9 , bylabel(Liberia) ||  /// 
			est10 , bylabel(Malawi) ||  /// 
			est11 , bylabel(Mali) ||  /// 
			est12 , bylabel(Mozambique) ||  /// 
			est13 , bylabel(Namibia) ||  /// 
			est14 , bylabel(Niger) ||  /// 
			est15 , bylabel(Senegal) ||  /// 
			est16 , bylabel(Sierra Leone) ||  /// 
			est17 , bylabel(South Africa) ||  /// 
			est18 , bylabel(Tanzania) ||  /// 
			est19 , bylabel(Togo) ||  /// 
			est20 , bylabel(Uganda) ||  /// 
			est21 , bylabel(Zambia) ||  /// 
			est22 , bylabel(Zimbabwe) ||  /// 
			, keep(znotrust_index) eform bycoefs xline (1) xlabel(1, add format(%9.2f) labsize(vsmall)) title("All basic vaccinations", size(medium)) levels(95) ///
			headings(1="{bf: }") mlabel format(%9.3f) mlabposition(2) mlabgap(*1) mlabsize(vsmall) msize(vsmall) m(d) ylabel(,labsize(small))
			
	
	
	*** Figure A.5 Robustness to dropping each SSA region's observations one at a time
		use "$data/DHS_AB_BMJ.dta",clear
			
		*** Panel A
			local kid "sex i.birthcat"
			local parents "age_mother age_mother_1stbirth literate school_mother school_father"
			local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
			local access "visit_12m problem_permission problem_money problem_distance problem_alone"
			local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

			eststo clear
			forvalues y=1(1)4 {	
			eststo: xi: logistic y1_none znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c if ssa_region!=`y' , cluster(idregion)
			}	
						
			coefplot ///
			est1 , bylabel(East Africa) 	||	/// 
			est2 , bylabel(Central Africa) 	||	/// 
			est3 , bylabel(West Africa) 	||	/// 
			est4 , bylabel(Southern Africa) || 	/// 
			, keep(znotrust_index) eform bycoefs xline (1) xlabel(1, add format(%9.2f) labsize(vsmall)) title("Panel A: None of the basic vaccinations", size(medium)) levels(95) ///
			headings(1="{bf: }") mlabel format(%9.2f) mlabposition(2) mlabgap(*1) mlabsize(vsmall) msize(vsmall) m(d) ylabel(,labsize(small))

		
		*** Panel B	
			local kid "sex i.birthcat"
			local parents "age_mother age_mother_1stbirth literate school_mother school_father"
			local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
			local access "visit_12m problem_permission problem_money problem_distance problem_alone"
			local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

			eststo clear
			forvalues y=1(1)4 {	
			eststo: xi: logistic y1_full znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c if ssa_region!=`y' , cluster(idregion)
			}	
				
			coefplot ///
			est1 , bylabel(East Africa) 	||	/// 
			est2 , bylabel(Central Africa) 	||	/// 
			est3 , bylabel(West Africa) 	||	/// 
			est4 , bylabel(Southern Africa) || 	/// 
			, keep(znotrust_index) eform bycoefs xline (1) xlabel(1, add format(%9.2f) labsize(vsmall)) title("Panel B: All basic vaccinations", size(medium)) levels(95) ///
			headings(1="{bf: }") mlabel format(%9.2f) mlabposition(2) mlabgap(*1) mlabsize(vsmall) msize(vsmall) m(d) ylabel(,labsize(small))
	
	
	
	*** Table A.19 Percentage of children with missing vaccination information
		use "$data/DHS_AB_missing_BMJ.dta",clear
		table country_year, c(mean vacc_missing) 
		sum vacc_missing
	
	
	
	*** Table A.20 Regression results for the association between institutional mistrust and child vaccination status, treating children with missing vaccination information as unvaccinated
		use "$data/DHS_AB_missing_BMJ.dta",clear
		
		gen y2_none=y1_none
		replace y2_none=1 if y2_none==. & vacc_missing==1
		gen y2_full=y1_full
		replace y2_full=0 if y2_full==. & vacc_missing==1	
		
		egen znotrust_index_wmissing=std(notrust_index) if vacc_missing!=.
		label var znotrust_index_wmissing "mistrust in public institutions (standardized)"

		local y2 "y2_none y2_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y2 {	
		eststo: xi: logistic `y' znotrust_index_wmissing i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c , cluster(idregion)
		}	
		
		esttab using "$data/Table_A20.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(5)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index_wmissing)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
		
	
	
	*** Table A.21 Robustness to using DHS sampling weights
		use "$data/DHS_AB_BMJ.dta",clear
		
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c [pw=wgt], cluster(idregion)
		}	
		
		esttab using "$data/Table_A21.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(5)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	

	
	
	*** Table A.22 Robustness to using de-normalized DHS sampling weights
		use "$data/DHS_AB_BMJ.dta",clear
					
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: logistic `y' znotrust_index i.year `kid' `parents' `HH' `accessm' `access' i.idregion i.age_c [pw=fancy_wgt] , cluster(idregion)
		}	
		
		esttab using "$data/Table_A22.rtf", eform replace cells(b(star fmt(2)) ci(fmt(2)par) p(fmt(5)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" ))  	
			
		
	
	*** Table A.23 Replicating Table 2 with aggregated vaccination coverages at the sub-national level
		use "$data/DHS_AB_BMJ.dta",clear
			
		collapse notrust_index y1_none y1_full sex birthcat age_mother age_mother_1stbirth literate school_mother school_father sex_head wealth nr_under5_w nr_hh_w urban visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem visit_12m problem_permission problem_money problem_distance problem_alone age_c , by(idregion start_year)
		egen znotrust_index=std(notrust_index)

		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: reg `y' znotrust_index sex birthcat `parents' sex_head wealth nr_under5_w nr_hh_w urban `accessm' `access' age_c i.idregion i.start_year
		}		
		
		esttab using "$data/Table_A23.rtf", replace cells(b(star fmt(3)) ci(fmt(3)par) p(fmt(4)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" )) 
 		
	
	
	*** Table A.24 Summary statistics of vaccination coverage and mistrust aggregated at the sub-national level
		use "$data/DHS_AB_BMJ.dta",clear
			
		collapse notrust_index y1_none y1_full sex birthcat age_mother age_mother_1stbirth literate school_mother school_father sex_head wealth nr_under5_w nr_hh_w urban visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem visit_12m problem_permission problem_money problem_distance problem_alone age_c , by(idregion start_year)
		egen znotrust_index=std(notrust_index)
		sum y1_none y1_full znotrust_index	
	
	
	
	*** Table A.25 Replicating Table 2 with aggregated vaccination coverages (with de-normalized sampling weights) at the sub-national level
		use "$data/DHS_AB_BMJ.dta",clear
	
		collapse notrust_index y1_none y1_full sex birthcat age_mother age_mother_1stbirth literate school_mother school_father sex_head wealth nr_under5_w nr_hh_w urban visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem visit_12m problem_permission problem_money problem_distance problem_alone age_c [iw=fancy_wgt], by(idregion start_year)
		egen znotrust_index=std(notrust_index)
	
		local y1 "y1_none y1_full"
		local kid "sex i.birthcat"
		local parents "age_mother age_mother_1stbirth literate school_mother school_father"
		local HH "sex_head i.wealth nr_under5_w nr_hh_w urban"
		local access "visit_12m problem_permission problem_money problem_distance problem_alone"
		local accessm "visit_12mm problem_permissionm problem_moneym problem_distancem problem_alonem"

		eststo clear
		foreach y of local y1 {	
		eststo: xi: reg `y' znotrust_index sex birthcat `parents' sex_head wealth nr_under5_w nr_hh_w urban `accessm' `access' age_c i.idregion i.start_year
		}		
		
		esttab using "$data/Table_A25.rtf", replace cells(b(star fmt(3)) ci(fmt(3)par) p(fmt(4)par)) star(* 0.05 ** 0.01 *** 0.001) nogaps label keep(znotrust_index)   ///
		stats (fe N r2_p, fmt(%9.2f %9.0fc %9.2f) labels("FE" "Observations" "Pseudo R2" )) 	
	
	
	
*** END ***	
